
#include "1221.h"


rt_uint16_t can_1221_config (_bms_total_info* bms_total_info,rt_uint8_t life)
{
	rt_uint16_t status = 0;
	
	bms_total_info->bms_info1.v_total		= 229.8*10;
	bms_total_info->bms_info1.i_total		= (17.6+3200)*10;
	bms_total_info->bms_info1.soc			= 93.4*5/2;
	bms_total_info->bms_info1.life		= life;
	bms_total_info->bms_info1.ed_sta		= 2;
	bms_total_info->bms_info1.ed_rev		= 1;
	bms_total_info->bms_info1.ed_main		= 1;
	bms_total_info->bms_info1.ed_mounth		= 12;
	bms_total_info->bms_info1.ed_year		= 18-17;
	
	bms_total_info->bms_info2.pack_num		= 3-1;
	bms_total_info->bms_info2.cell_tol		= 138-1;
	bms_total_info->bms_info2.ser_num		= 69-1;
	bms_total_info->bms_info2.par_num		= 2-1;
	bms_total_info->bms_info2.elec_q		= 27.58*100;
	//bms_total_info->bms_info2.empty		= 0;
	
	bms_total_info->bms_tem1.max_tem		= 60+40;
	bms_total_info->bms_tem1.min_tem		= 0+40;
	bms_total_info->bms_tem1.tem_g_num		= 3-1;
	bms_total_info->bms_tem1.tem_g_c1		= 22+40;
	bms_total_info->bms_tem1.tem_g_c2		= 20+40;
	bms_total_info->bms_tem1.tem_g_c3		= 23+40;
	bms_total_info->bms_tem1.tem_g_c4		= 21+40;
	bms_total_info->bms_tem1.tem_g_c5		= 25+40;
	
	bms_total_info->bms_tem2.highest_g		= 1-1;
	bms_total_info->bms_tem2.highest_c		= 5-1;
	bms_total_info->bms_tem2.highest_t		= 25+40;
	bms_total_info->bms_tem2.lowest_g		= 1-1;
	bms_total_info->bms_tem2.lowest_c		= 2-1;
	bms_total_info->bms_tem2.lowest_t		= 20+40;
	bms_total_info->bms_tem2.tem_range		= (bms_total_info->bms_tem2.highest_t) - (bms_total_info->bms_tem2.lowest_t);
	//bms_total_info->bms_tem2.empty		= 0;
	
	bms_total_info->bms_vol1.max_v_cg		= 252*100;
	bms_total_info->bms_vol1.min_v_discg	= 194*100;
	bms_total_info->bms_vol1.highest_v_cg	= 3.65*50;
	bms_total_info->bms_vol1.lowest_v_discg	= 2.8*50;
	//bms_total_info->bms_vol1.empty		= 0;
	
	bms_total_info->bms_vol2.vol_g_num		= 5-1;
	bms_total_info->bms_vol2.vol_g_c1		= 3.28*50;
	bms_total_info->bms_vol2.vol_g_c2		= 3.33*50;
	bms_total_info->bms_vol2.vol_g_c3		= 3.23*50;
	bms_total_info->bms_vol2.vol_g_c4		= 3.28*50;
	bms_total_info->bms_vol2.vol_g_c5		= 3.26*50;
	bms_total_info->bms_vol2.vol_g_c6		= 3.38*50;
	bms_total_info->bms_vol2.vol_g_c7		= 3.31*50;
	
	bms_total_info->bms_vol3.highest_g		= 5-1;
	bms_total_info->bms_vol3.highest_c		= 6-1;
	bms_total_info->bms_vol3.highest_v		= 3.38*50;
	bms_total_info->bms_vol3.lowest_g		= 5-1;
	bms_total_info->bms_vol3.lowest_c		= 3-1;
	bms_total_info->bms_vol3.lowest_v		= 3.23*50;
	bms_total_info->bms_vol3.vol_range		= (bms_total_info->bms_vol3.highest_v)-(bms_total_info->bms_vol3.lowest_v);
	//bms_total_info->bms_vol3.empty		= 0;
	
	bms_total_info->bms_current.cg_i_max	= 120*100;
	bms_total_info->bms_current.discg_i_max	= 600*100;
	//bms_total_info->bms_current.empty1	= 0;
	//bms_total_info->bms_current.empty2	= 0;
	
	bms_total_info->bms_alm_sta.alm_type	= 1;
	bms_total_info->bms_alm_sta.alm_code1	= 1;
	bms_total_info->bms_alm_sta.alm_code2	= 1;
	bms_total_info->bms_alm_sta.alm_code3	= 1;
	bms_total_info->bms_alm_sta.power_sta	= 1;
	bms_total_info->bms_alm_sta.pre_cg_sta	= 1;
	bms_total_info->bms_alm_sta.c_cg_sta	= 1;
	bms_total_info->bms_alm_sta.f_charge	= 1;
	bms_total_info->bms_alm_sta.charge_en	= 1;
	bms_total_info->bms_alm_sta.balance_sta	= 1;
	bms_total_info->bms_alm_sta.balance_en	= 1;
	bms_total_info->bms_alm_sta.charge_sta	= 1;
	bms_total_info->bms_alm_sta.interlock1	= 1;
	bms_total_info->bms_alm_sta.interlock2	= 1;
	bms_total_info->bms_alm_sta.insul_res	= 9000/10;
	
	bms_total_info->bms_cg.charge_v_h		= 0x09;
	bms_total_info->bms_cg.charge_v_l		= 0xA1;
	bms_total_info->bms_cg.charge_i_h		= 0x00;
	bms_total_info->bms_cg.charge_i_l		= 0x10;
	bms_total_info->bms_cg.charge_en		= 1;
}


